package com.wugz.app.controller;

import com.wugz.app.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @ClassName ArticleController
 * @Description
 * @Author wugz
 * @Date 2020/3/21 18:59
 * @Version 1.0
 */
@Controller
public class ArticleController {

    @Autowired
    private ArticleService articleService;

    @RequestMapping("/")
    public String toIndexPage(Model model, @RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "3") Integer pageSize){
        model.addAttribute("article", articleService.list(page,pageSize));
        return "client/index";
    }
}
